package org.example.leetcode.common._enum;

import org.example.leetcode.common.domain.CodeExecutorConstant;
import org.springframework.beans.factory.annotation.Value;

public enum LanguageEnum implements BaseEnum<String,String>{
    C("C",".c","gcc","CExecutor","/root/leetcode/C/Dockerfile","/root/leetcode/C"),
    JAVA("JAVA",".java","javac","JavaExecutor","/root/leetcode/JAVA/Dockerfile","/root/leetcode/JAVA");
    private String language;
    private String suffix;
    private String compileCode;
    private String beanName;
    private String dockerFile;
    private String targetUrl;
    private LanguageEnum(String language,String suffix,String compileCode,String beanName,String dockerFile,String targetUrl){
        this.language=language;
        this.suffix=suffix;
        this.compileCode=compileCode;
        this.beanName=beanName;
        this.dockerFile=dockerFile;
        this.targetUrl=targetUrl;
    }

    public void setLanguage(String language) {
        this.language = language;
    }

    public void setSuffix(String suffix) {
        this.suffix = suffix;
    }

    public void setCompileCode(String compileCode) {
        this.compileCode = compileCode;
    }

    public void setBeanName(String beanName) {
        this.beanName = beanName;
    }

    public void setDockerFile(String dockerFile) {
        this.dockerFile = dockerFile;
    }

    public String getTargetUrl() {
        return targetUrl;
    }

    public void setTargetUrl(String targetUrl) {
        this.targetUrl = targetUrl;
    }

    @Override
    public String getCode() {
        return language;
    }

    @Override
    public String getName() {
        return language;
    }
    public String getSuffix(){
        return this.suffix;
    }

    public String getLanguage() {
        return language;
    }



    public String getCompileCode() {
        return compileCode;
    }

    public String getBeanName() {
        return beanName;
    }
    public String getDockerFile(){return dockerFile;}
    public static LanguageEnum getLanguage(String language){
        for (LanguageEnum value : LanguageEnum.values()) {
            if(value.getLanguage().equals(language)){
                return value;
            }
        }
        return null;
    }
}
